import request from '@/utils/httpRequest'

export function fetchList(query) {
  return request({
    url: request.adornUrl('/delivery/deliveryman/page'),
    method: 'get',
    params: query
  })
}

export function getDeliverymanList(query) {
  return request({
    url: request.adornUrl('/delivery/deliveryman/getDeliverymanList'),
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: request.adornUrl('/delivery/deliveryman/register'),
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: request.adornUrl('/delivery/deliveryman/' + id),
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: request.adornUrl('/delivery/deliveryman/' + id),
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: request.adornUrl('/delivery/deliveryman'),
    method: 'post',
    data: obj
  })
}

export function updateObj(obj) {
  return request({
    url: request.adornUrl('/delivery/deliveryman/updateDelivery'),
    method: 'post',
    data: obj
  })
}

export function deliveryCheck(data) {
  return request({
    url: request.adornUrl('/delivery/deliveryman/deliveryCheck'),
    method: 'post',
    data
  })
}

export function search(data) {
  return request({
    url: request.adornUrl('/delivery/deliveryman/searchDelivery'),
    method: 'post',
    data
  })
}
